from django.contrib.syndication.feeds import Feed
from django.utils.feedgenerator import Atom1Feed
from models import Book


class RssFeeds(Feed):
    title = "Book List"
    link = "/search/"
    description = "Updates on books"
    
    def items(self):
        return Book.objects.order_by('-publish_date')[:5]
    
    def item_link(self):
        return "www.abc.com"

class AtomFeeds(RssFeeds):
    feed_type = Atom1Feed
    subtitle = RssFeeds.description
    